/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package observer_cod_ruim;

/**
 *
 * @author Marcel
 */
public class CurrentConditionsDisplay implements Subject, Observer {
    private float temperature;
    private float humidity;
    private Subject weatherData;
    
    public CurrentConditionsDisplay () {
        this.weatherData = weatherData;
        weatherData.registerObserver(this);
    }

    @Override
    public void update(float temp, float humidity, float pressure) {
        this.temperature = temperature;
        this.humidity = humidity;
        display();
    }
    
    public void display () {
        System.out.println(temperature+" "+humidity);
    }

    @Override
    public void registerObserver(Observer o) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void removeObserver(Observer o) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void notifyObserver() {
        throw new UnsupportedOperationException("Not supported yet.");
    }
}
